/**
 * FireFly (2011)
 */
package com.firefly.kernel.plugins.event;

import com.firefly.kernel.spi.event.IKernelEvent;
import com.firefly.util.FireflyObject;

/**
 * 核心抽象事件
 * 
 * @version 1.0 2011-1-2
 * @author lexloo(lexloo@gmail.com)
 * @since FireFly 1.0
 */
public class AbstractEvent extends FireflyObject implements IKernelEvent {
	/** 事件源 */
	protected Object source;

	/** 事件类型 */
	protected String type;

	/** 次序 */
	protected long sequence;

	/** 时间戳 */
	protected long timestamp;

	/** 上下文 */
	protected Object context;

	public AbstractEvent(Object source, String type, long sequence, long timestamp, Object context) {
		this.source = source;
		this.type = type;
		this.sequence = sequence;
		this.timestamp = timestamp;
		this.context = context;
	}

	@Override
	public Object getContext() {
		return this.context;
	}

	@Override
	public long getSequence() {
		return this.sequence;
	}

	@Override
	public Object getSource() {
		return this.source;
	}

	@Override
	public long getTimestamp() {
		return this.timestamp;
	}

	@Override
	public String getType() {
		return this.type;
	}
}
